home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Rockford Magazine
/
Rockford_Magazine_022_19xx_-_de_Disk_2_of_4_Side_B.d64
/
miniature golf
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
10KB
|
360 lines
10 rem ********************
11 rem *** ***
12 rem ** miniature golf **
13 rem *** ***
14 rem ********************
15 :
16 :
20 gosub1000:rem instructions
30 gosub2000:rem setup
40 gosub3000:rem play!
50 gosub4000:rem !end!
60 end
70 :
1000 :
1001 :rem *** insts ***
1002 :
1003 poke53281,1:poke53280,1
1010 print"[147][152]"
1020 printtab(9)"*** miniature golf ***
1025 [153]:[153]
1030 [153]"welcome to the alberts country club. this beautiful nine-hole ";
1031 [153]"miniature golf course is open and waiting for you !"
1035 [153]
1040 [153]"you should know the rules of the course before you begin play !"
1041 [153]
1045 [153]"to putt the ball,you have to input which way you want to ";
1046 [153]"aim it."
1047 [153]"there are 8 directions, shown below your ball is assumed to be at *"
1050 [153]:[153][163]17)"2 1 8":[153][163]17)"3 * 7":[153][163]17)"4 5 6"
1060 [153]:[153]:[153]"press return when ready to continue"
1065 [161]x$:[139]x$[179][177][199](13)[167]1065
1070 [153]"load"
1075 [153][163]9)"*** miniature golf ***
1076 print:print
1080 print"then you must input how hard to hit the ball. the speed should ";
1081 print"be some number between 0.00 and 5.00. for example, youcould";
1082 print" hit the ball a relative speed of 3.2"
1085 print
1090 print"it will take a few tries before you get used to how hard to putt ";
1095 print"the ball.":print
1100 print"also, there are four types of hazards onthe course. you should ";
1105 print"be aware of whatthey are and what affect they have on you ";
1106 print"and your ball."
1110 print:print:print:print"press return when ready to continue"
1115 getx$:ifx$<>chr$(13)then1115
1120 print"[147]"
1125 printtab(9)"*** miniature golf ***
1126 [153]:[153]
1130 [153]"blocks: these are like walls. you must putt around them."
1135 [153]
1140 [153]"yellow traps represent sand. your ball cannot penetrate through ";
1141 [153]"a sand trap. the penalty for landing in the sand is one stroke."
1145 [153]
1150 [153]"water: like sand, these blue hazards will stop your ball.";
1151 [153]" the penalty for landing in water is one stroke."
1155 [153]
1160 [153]"uneven surfaces: these red hazards causethe ball to roll in ";
1165 [153]"a direction which isunpredictable there is no penalty ";
1166 [153]"forhitting this hazard."
1170 [153]:[153]:[153]"press return when ready to continue"
1175 [161]x$:[139]x$[179][177][199](13)[167]1175
1180 [153]"loadprint#"
1185 [153][163]9)"*** miniature golf ***
1186 print:print
1190 print"you are trying to sink the ball in as few tries as possible. ";
1191 print"the hole is the black square."
1195 print
1200 print"if you hit the ball too hard, it will jump over the hole and ";
1205 print"continue rolling.it may also change direction, so be sureto hit ";
1206 print"the ball just hard enough."
1210 print:print:print"press return when ready to continue"
1215 getx$:ifx$<>chr$(13)then1215
1990 return
2000 :
2001 :rem *** setup ***
2002 :
2010 dimha(9,5):fori=1to9:forj=1to5:readha(i,j):next:next
2011 data 0,0,0,0,2
2012 data 1,0,0,0,3
2013 data 0,1,0,0,3
2014 data 1,1,0,0,3
2015 data 0,0,0,1,3
2016 data 0,0,1,1,3
2017 data 1,0,1,0,3
2018 data 0,1,1,0,4
2019 data 0,0,1,1,3
2020 dimdi(8,2):fori=1to8:readdi(i,1),di(i,2):next
2025 data 0,-1, -1,-1, -1,0, -1,1, 0,1, 1,1, 1,0, 1,-1
2030 plt=49152:fori=0to24:readc:pokeplt+i,c:nexti
2031 data32,16,192,132
2032 data253,32,16,192
2033 data152,170,164,253
2034 data24,76,240,255
2035 data32,253,174,32
2036 data158,173,76,170,177
2040 dimv(8):fori=1to8:readv(i):next:data-40,-41,-1,39,40,41,1,-39
2050 :
2055 def fnco(x)=peek(55296+bx+40*by+x)and15
2060 def fnsc(x)=peek(1024+bx+40*by+x)
2090 return
2100 rem *** hole 1 ***
2105 gosub2050
2106 print""
2110 printtab(10)"[144][172][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187]"
2112 fori=1to15
2115 printtab(10)"[161] [146][144][161]"
2120 next
2125 printtab(10)"[144][188][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][146][190]"
2130 print""tab(19)" "
2135 by=16:bx=11+int(17*rnd(0)):sysplt,bx,by:print"[209]";
2140 return
2200 rem *** hole 2 ***
2205 gosub2050
2206 print""
2210 printtab(8)"[144][172][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187]"
2212 fori=1to5
2215 printtab(8)"[161] [146][144][161]"
2220 next
2221 printtab(8)"[161] [144][172][162][162][162][162][162][162][162][162][162][146][190]"
2222 printtab(8)"[161] [146][144][161]"
2223 printtab(8)"[161] [146][144][161]"
2224 printtab(8)"[161] [146][144][161]"
2225 printtab(8)"[161] [146][144][161]"
2226 fori=1to6
2227 printtab(8)"[161] [146][144][161]"
2230 next
2235 printtab(8)"[188][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][146][190]"
2240 by=17:bx=9+int(15*rnd(0)):sysplt,bx,by:print"[209]";
2245 print""tab(30)"[144] "
2250 return
2300 rem *** hole 3 ***
2306 print""
2310 printtab(20)"[144][172][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187]"
2312 fori=1to5
2315 printtab(20)"[161] [146][144][161]"
2320 next
2321 printtab(8)"[146][172][162][162][162][162][162][162][162][162][162][162][162][190] [146][144][161]"
2322 printtab(8)"[161] [146][144][161]"
2323 printtab(8)"[161] [158] [146][144][161]"
2324 printtab(8)"[161] [158] [146][144][161]"
2325 printtab(8)"[161] [158] [146][144][161]"
2326 printtab(8)"[161] [158] [146][144][161]"
2335 printtab(8)"[161] [144][172][162][162][162][162][162][162][162][162][162][162][162][146][190]"
2340 fori=1to4
2345 printtab(8)"[161] [146][144][161]"
2350 next
2355 printtab(8)"[146][188][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][146][190]"
2360 print""tab(32)"[144] "
2365 by=17:bx=9+int(15*rnd(0)):sysplt,bx,by:print"[209]"
2390 return
2400 rem *** hole 4 ***
2406 print""
2410 printtab(7)"[144][172][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187]"
2412 fori=1to6
2415 printtab(7)"[161] [146][144][161]"
2420 next
2421 printtab(7)"[161] [144][172][162][162][162][162][162][162][162][162][162][187][146] [146][144][161]"
2425 fori=1to4
2430 printtab(7)"[161] [144][146][161] [161] [146][144][161]"
2435 next
2440 printtab(7)"[161] [144][188][146][162][162][162][187] [188][162][162][162][162][162][162][162][162][162][162][162][146][190]"
2445 fori=1to3
2450 printtab(7)"[161] [144][146][161]"
2455 next
2460 printtab(7)"[188][162][162][162][162][162][162][162][162][162][162][162][146][190]"
2465 print""tab(18)"[158] [157][157][157][157][157][157] [157][157][157][157] "
2470 printtab(25)" [157][157][157] [157][157][157][157][157] [157][157] "
2475 sysplt,32,10:print"[144] "
2480 by=16:bx=8+int(10*rnd(0)):sysplt,bx,by:print"[209]"
2490 return
2500 rem *** hole 5 ***
2505 print""
2506 print""
2510 printtab(10)"[144][172][162][162][162][162][163][255][255][255][255][163][255][255][255][255][162][162][162][162][162][162][162][162][187]"
2512 fori=1to15
2515 printtab(10)"[161] [146][144][161]"
2520 next
2525 printtab(10)"[144][188][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][146][190]"
2530 sysplt,19,6:print"[173][195][195][195][195][195][189]"
2535 sysplt,22,4:print"[144] "
2540 by=16:bx=11+int(23*rnd(0)):sysplt,bx,by:print"[209]"
2590 return
2600 rem *** hole 6 ***
2605 gosub2050
2606 print""
2610 printtab(8)"[144][172][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187]"
2612 fori=1to7
2615 printtab(8)"[161] [146][144][161]"
2620 next
2625 printtab(8)"[161] [144][172][162][162][162][162][162][162][162][162][162][146][190]"
2630 fori=1to7
2635 printtab(8)"[161] [146][144][161]"
2640 next
2645 printtab(8)"[188][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][146][190]"
2650 sysplt,27,4:print"[176][157][194][157][173]"
2655 sysplt,20,5:print" [157][157][157][157][157][157] [157][157][157][157][157] [157][157] "
2660 sysplt,30,5:print"[144] "
2665 by=16:bx=9+int(15*rnd(0)):sysplt,bx,by:print"[209]"
2690 return
2700 rem *** hole 7 ***
2706 print""
2710 printtab(8)"[144][172][162][162][162][162][162][162][162][162][162][162][162][162][187]"
2712 fori=1to4
2715 printtab(8)"[161] [146][144][161]"
2720 next
2721 printtab(8)"[161] [144][188][146][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187]"
2725 fori=1to4
2727 printtab(8)"[161] [144][146][161]"
2730 next
2735 printtab(8)"[144][188][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187] [144][146][161]"
2740 fori=1to5
2745 printtab(24)"[144][161] [144][146][161]"
2750 next
2755 printtab(24)"[144][188][162][162][162][162][162][162][162][162][162][162][162][162][162][146][190]"
2760 sysplt,9,7:print" [157][157][157][157] [157][157][157][157] [157][157][157][157][157] "
2765 sysplt,27,7:print" [157][157][157][157][157][157] [157][157][157][157][157][157] [157][157][157][157][157][157][157] "
2770 sysplt,13,4:print"[144] "
2775 by=16:bx=25+int(13*rnd(0)):sysplt,bx,by:print"[209]"
2799 return
2800 rem *** hole 8 ***
2806 print""
2810 printtab(7)"[144][172][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187]"
2812 fori=1to6
2815 printtab(7)"[161] [146][144][161]"
2820 next
2821 printtab(7)"[161] [144][172][162][162][162][162][162][162][162][187] [146][144][161]"
2825 fori=1to4
2830 printtab(7)"[161] [144][146][161] [161] [146][144][161]"
2835 next
2840 printtab(7)"[188][162][162][162][162][162][162][162][162][162][162][146][190] [161] [144][146][161]"
2845 fori=1to3
2850 printtab(26)"[161] [144][146][161]"
2855 next
2860 printtab(26)"[188][162][162][162][162][162][162][162][162][162][162][146][190]"
2865 sysplt,28,2:print" "
2866 sysplt,29,3:print" "
2867 sysplt,30,4:print" "
2868 sysplt,30,5:print" "
2869 sysplt,32,6:print" "
2870 sysplt,33,7:print" "
2875 sysplt,13,3:print"[158] [157][157][157][157] [157][157][157][157][157] [157][157][157][157] "
2880 sysplt,13,10:print"[144] "
2885 by=16:bx=27+int(10*rnd(0)):sysplt,bx,by:print"[209]"
2890 return
2900 rem *** hole 9 ***
2905 gosub2050
2906 print""
2910 printtab(8)"[144][172][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187]"
2912 fori=1to9
2915 printtab(8)"[161] [146][144][161]"
2920 next
2921 printtab(8)"[188][162][162][162][162][162][162][162][162][162][162][162][187] [146][144][161]"
2925 fori=1to5
2927 printtab(20)"[161] [146][144][161]"
2930 next
2935 printtab(20)"[188][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][146][190]"
2940 sysplt,21,2:print" "
2941 sysplt,22,3:print" "
2942 sysplt,23,4:print" "
2943 sysplt,24,5:print" "
2944 sysplt,25,6:print" "
2950 sysplt,11,6:print"[144] "
2955 sysplt,14,5:print"[174][157][194][157][189]"
2960 by=16:bx=21+int(15*rnd(0)):sysplt,bx,by:print"[209]"
2990 return
3000 :
3001 :rem *** play ***
3002 :
3010 forho=1to9:bc$=""
3015 print"[147]";
3020 onhogosub2100,2200,2300,2400,2500,2600,2700,2800,2900
3030 print"[154]hole number:"ho"par:"ha(ho,5)"score:"sc
3031 print:print"traps:":ifha(ho,1)thenprint"water"
3032 ifha(ho,2)thenprint"[158]sand"
3033 ifha(ho,3)thenprint"uneven"
3034 ifha(ho,4)thenprint"[144]blocks"
3035 print:print"[144]2 1 8":print"3 [209] 7":print"4 5 6"
3036 sysplt,0,19:fori=1to5:print" ":next
3038 d$="":sysplt,0,20:input"direction (1-8)";d$:dir=val(d$)
3040 ifdir>0anddir<9anddir=int(dir)then3045
3041 print"the direction is from 1 to 8 ...":forpa=1to1500:next:goto3036
3045 sysplt,0,19:fori=1to5:print" ":next
3046 d$="":sysplt,0,20:input"speed (0-5)";d$:sp=val(d$)
3050 ifsp=>0andsp<=5then3055
3051 print"the speed is from 0 to 5...":forpa=1to1500:next:goto3045
3055 uf=0:rem clear uneven flag
3056 tf=0:rem clear trap flag
3100 x2=bx+di(di,1):y2=by+di(di,2)
3110 d2=v(di):co=fnco(d2):ifco<>5orfnsc(d2)<>160then3120
3115 sysplt,bx,by:printbc$" ";:bx=x2:by=y2:sysplt,bx,by:print"[209]";
3116 bc$="":goto3900
3120 ifco=0andfnsc(d2)<>160then3200:rem hit a wall
3121 ifco=6then3300:rem water
3122 ifco=7then3400:rem sand
3123 ifco=2then3500:rem uneven
3124 ifco=0then3600:rem the hole
3200 ifdi=1ordi=3thendi=di+4:goto3100
3201 ifdi=7ordi=5thendi=di-4:goto3100
3210 ondi/2goto3220,3240,3260,3280
3220 iffnsc(d2+1)<>160andfnsc(d2+40)<>160thendi=6:goto3100
3225 iffnsc(d2+1)<>160thendi=4:goto3100
3230 iffnsc(d2+40)<>160thendi=8:goto3100
3235 di=6:goto3100
3240 iffnsc(d2+1)<>160andfnsc(d2-40)<>160thendi=8:goto3100
3245 iffnsc(d2+1)<>160thendi=2:goto3100
3250 iffnsc(d2-40)<>160thendi=6:goto3100
3255 di=8:goto3100
3260 iffnsc(d2-1)<>160andfnsc(d2-40)<>160thendi=2:goto3100
3265 iffnsc(d2-1)<>160thendi=8:goto3100
3270 iffnsc(d2-40)<>160thendi=4:goto3100
3275 di=2:goto3100
3280 iffnsc(d2-1)<>160andfnsc(d2+40)<>160thendi=4:goto3100
3285 iffnsc(d2-1)<>160thendi=6:goto3100
3290 iffnsc(d2+40)<>160thendi=2:goto3100
3295 di=4:goto3100
3300 iftfthen3310
3305 tf=3:sc=sc+1:rem trap flag
3310 sysplt,bx,by:printbc$" ";
3315 bx=x2:by=y2:sysplt,bx,by:print"[209]";:bc$=""
3320 goto3900
3400 iftfthen3410
3405 tf=3:sc=sc+1:rem trap flag
3410 sysplt,bx,by:printbc$" ";
3415 bx=x2:by=y2:sysplt,bx,by:print"[158][209]";:bc$="[158]"
3420 goto3900
3500 ifufthen3520
3505 uf=1:rem uneven flag, have re rolled ball off course yet?...
3510 di=di+2*int(2*rnd(0))-1
3515 ifdi=0theni=8
3516 ifdi=9theni=1
3520 sysplt,bx,by:printbc$" ";
3525 bx=x2:by=y2:sysplt,bx,by:print"[209]";:bc$=""
3530 goto3900
3600 sysplt,bx,by:print" ":sysplt,x2,y2:print" "
3601 sysplt,x2,y2:print"[144] ";
3602 di=di+2*int(2*rnd(0))-1
3604 ifdi=0thendi=8
3605 ifdi=9thendi=1
3606 sp=sp-.5:ifsp>0thenx2=x2+di(di,1):y2=y2+di(di,2):goto3110
3610 sc=sc+1:goto3990
3900 :
3902 iftf>0thentf=tf-1:iftf=0then3910
3905 sp=sp-.3:ifsp>0then3100
3910 sc=sc+1:goto3030
3980 getx$:ifx$=""then3980
3990 nextho:return
4000 :
4001 :rem *** end ***
4002 :
4005 forpa=1to200:nextpa
4010 print"[147]";tab(9)"*** miniature golf ***"
4015 print:print:print:print
4020 print"the game is over !"
4022 print
4025 print"on the par 27 course, you shot":print"a round of"sc". that is an"
4026 print"average of"int(sc*100/9)/100"shots per hole."
4030 print:print:print
4035 print"hope you enjoyed the game!"
4990 return